﻿<UserControl x:Class="MathematicallySafe.HeadCounter.Views.GeneralOptionsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Initialized="OptionsGeneralInitialized">

    <UserControl.Resources>
        
    </UserControl.Resources>

    <Grid Style="{StaticResource TabContainer}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="2*"/>
            <ColumnDefinition Width="16"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="16"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>    

        <TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource ScreenHeadingStyle}">Guild Details</TextBlock>

        <TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Style="{StaticResource ScreenTextStyle}" 
                   Text="Enter the name of your Guild or Raid group." />
        <TextBox Grid.Row="1" Grid.Column="2" Text="{Binding GuildName}" />
        
        <TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Style="{StaticResource ScreenTextStyle}" 
                   Text="Enter the realm on which your guild is located." />
        <TextBox Grid.Row="2" Grid.Column="2" Text="{Binding Realm}" />
        <TextBlock Grid.Row="3" Grid.Column="0" Style="{StaticResource ScreenTextStyle}" Text="Select your region." />
        <ComboBox Grid.Row="3" Grid.Column="2"  HorizontalAlignment="Left" ItemsSource="{Binding Regions}" SelectedItem="{Binding Region}"/>

        <TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource ScreenHeadingStyle}">Gear Scores</TextBlock>
        <TextBlock Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="3" Style="{StaticResource ScreenTextStyle}" Text="These values control how gear values are calculated." />
        <TextBlock Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" Style="{StaticResource ScreenTextStyle}" Text="Gear is valued relative to this base iLevel. i.e. gear of this iLevel is 'free'" />
        <TextBox Grid.Row="6" Grid.Column="4" Width="40" HorizontalAlignment="Left" TextAlignment="Center" Text="{Binding iLevelBase}" />
        <TextBlock Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4" Style="{StaticResource ScreenTextStyle}" Text="Your current progression level. This value is only used to determine the number of 'progression' items awarded" />
        <TextBox Grid.Row="7" Grid.Column="4" Width="40" HorizontalAlignment="Left" TextAlignment="Center" Text="{Binding iLevelProgression}" />

        <TextBlock Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="1" Style="{StaticResource ScreenHeadingStyle}">Percentages</TextBlock>
        <TextBlock Grid.Row="9" Grid.Column="0" Grid.ColumnSpan="1" Style="{StaticResource ScreenTextStyle}" Text="These values control how gear values are calculated." />
        <TextBlock Grid.Row="10" Grid.Column="0" Grid.ColumnSpan="1" Style="{StaticResource ScreenTextStyle}" Text="The minimum short period attendance % required to loot" />
        <TextBox Grid.Row="10" Grid.Column="2" Width="40" HorizontalAlignment="Left" TextAlignment="Center" Text="{Binding MinAttendancePercent}" />
        <TextBlock Grid.Row="11" Grid.Column="0" Grid.ColumnSpan="4" Style="{StaticResource ScreenTextStyle}" Text="Attendance above this value does not improve loot priority" />
        <TextBox Grid.Row="11" Grid.Column="2" Width="40" HorizontalAlignment="Left" TextAlignment="Center" Text="{Binding MaxEffectiveAttendancePercent}" />
        
        <TextBlock Grid.Row="12" Grid.Column="0" Margin="0,16,0,0" Style="{StaticResource ScreenTextStyle}" Text="Poor/Fair/Good/High Attendance Percentages" />
        <UniformGrid Rows="1" Grid.Row="12" Grid.Column="2" Grid.ColumnSpan="3" Margin="0,16,0,0">
            <TextBlock Margin="0,0,8,0" Foreground="{StaticResource LowAttendanceColour}" VerticalAlignment="Center" HorizontalAlignment="Left"
                       Text="{Binding FairAttendancePercentage, StringFormat=&lt; {0:F0}}" />
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" >
                <TextBlock Margin="0,0,8,0" Foreground="{StaticResource FairAttendanceColour}" VerticalAlignment="Center"
                           Text="{Binding FairAttendancePercentage, StringFormat={}{0:F0}}" />
                <Slider Name="FairSlider" Width="60" VerticalAlignment="Center"
                        Minimum="40" Maximum="{Binding GoodAttendancePercentage}" Value="{Binding FairAttendancePercentage}" />    
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" >
                <TextBlock Margin="0,0,8,0" Foreground="{StaticResource GoodAttendanceColour}" VerticalAlignment="Center"
                           Text="{Binding GoodAttendancePercentage, StringFormat={}{0:F0}}" />
                <Slider Name="GoodSlider" Width="60" VerticalAlignment="Center"
                        Minimum="50" Maximum="{Binding HighAttendancePercentage}" Value="{Binding GoodAttendancePercentage}" />    
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" >
                <TextBlock Margin="0,0,8,0" Foreground="{StaticResource HighAttendanceColour}" VerticalAlignment="Center"
                           Text="{Binding HighAttendancePercentage, StringFormat={}{0:F0}}" />
                <Slider Name="HighSlider" Width="60" VerticalAlignment="Center"
                        Minimum="60" Maximum="{Binding MaxEffectiveAttendancePercent}" Value="100" />    
            </StackPanel>
        </UniformGrid>
        
        <TextBlock Grid.Row="13" Grid.Column="0" Grid.ColumnSpan="1" Style="{StaticResource ScreenHeadingStyle}">Other</TextBlock>
        <CheckBox Grid.Row="14" Grid.Column="0" Grid.ColumnSpan="1" Style="{StaticResource ScreenCheckBoxStyle}" IsChecked="{Binding AutoApplyAttendanceCreditToDeletedRaiders}" Content="When a raider is removed from a raid automatically grant them attendance credit" />

    </Grid>
    
</UserControl>
